#!/bin/bash
# #!/usr/bin/env bash
# Date : 2018 05 26
# Author: ljwnet163@163.com
# 

# a=192.168.1.160
# b='192.168.1.160'
# c="192.168.1.160"

# echo $c-${a}

OLDB="i'm a old boy,i'm a clever boy"
# echo "原字符是: "$OLDB

# echo "string_length: " ${#OLDB}
# echo "string_cut->3: " ${OLDB:3:5}
# echo "string_LeftTrim->*i'm a: "${OLDB#*"i'm a "}
# echo "string_LeftTrim_more->*i'm a: "${OLDB##*"i'm a "}
# echo "string_RightTrim->boy*: "${OLDB%"boy"*}
# echo "string_RightTrim_more->boy*: "${OLDB%%"boy"*}
# echo "string_replace->girl: "${OLDB/%"boy"/"girl"}
unset OLDB1 OLDB2 OLDB3
## 用于给未定义变量取值
echo ${OLDB1-qwe11}
## 用于给未定义变量赋值
echo ${OLDB2=qwe22}
## 演示bash效果
echo ${OLDB3:?qwe33}
#依然空
echo $OLDB1
#OLDB2被赋值qwe22
echo $OLDB2
#依然空
echo $OLDB3

